#define _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        int prev = -1;
        int pcur = 0;
        while (pcur <= nums.size() - 1)
        {
            if (pcur <= nums.size() - 1 && nums[pcur] != 0)
            {
                swap(nums[prev + 1], nums[pcur]);
                prev++;
            }
            else
            {
                ;
            }
            pcur++;
        }
    }
};